package com.fpost.manager;

import java.util.List;

import org.hibernate.HibernateException;

import com.fpost.dao.impl.ArticleVersionDAO;
import com.fpost.dao.impl.UserDAO;
import com.fpost.domain.ArticleVersion;
import com.fpost.domain.User;

public class ArticleVersionManager {
	
	public Long save(ArticleVersion articleVersion) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		return dao.save(articleVersion);		
	}

	public void saveOrUpdate(ArticleVersion articleVersion) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		dao.saveOrUpdate(articleVersion);
	}

	public void delete(long id) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		dao.delete(id);
		
	}

	public ArticleVersion get(long id) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		return dao.get(id);
	}
	
	public ArticleVersion getByArticleVersionId(long articleVersionId) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		return dao.getByArticleVersionId(articleVersionId);
	}
	
	public List<ArticleVersion> getByInputKey(String input) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		return dao.getByInputKey(input);
	}
	
	public List<ArticleVersion> getByInputAndType(String input, long articleTypeId) throws HibernateException {
		ArticleVersionDAO dao = new ArticleVersionDAO();
		return dao.getByInputAndType(input, articleTypeId);
	}
	
	public List<ArticleVersion> getAll() {		
		ArticleVersionDAO dao = new ArticleVersionDAO();
		return dao.getAll();
	}
}
